package com.haomin.terra_cotta_warriors.repository;

import com.haomin.terra_cotta_warriors.data_object.ParClass;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
@Mapper
public interface PerClassRepo {
    @Select("select pid, pname from parclass")
    List<ParClass> selectAll();

    @Insert("insert into parclass (pname) values (#{pname})")
    int insertOne(ParClass parClass);

    @Select("select pid from parclass where pname = #{pname}")
    int selectPid(String pname);
}
